﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string filePath = Server.MapPath("~\\Files\\Sentence.txt");
        if (!Page.IsPostBack)
            sentenceSpan.InnerText = ReadSentenceFile(filePath);

       // if (Session["ExceptionHandler"] != null)
         //   Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "ExceptionHandler", string.Format("showModalDialog('{0}/ExceptionManagement/ExceptionHandler.aspx','', 'dialogWidth:390px;dialogHeight:360px;center:yes;status:no;scroll:no', '');", Request.ApplicationPath), true);
    }

    private string ReadSentenceFile(string filePath)
    {
        if (File.Exists(filePath))
        {
            StreamReader streamReader = File.OpenText(filePath);
            return streamReader.ReadToEnd();
        }
        return string.Empty;
    }
}